package day5;

import java.util.Scanner;

/**
 * @author oldliu
 * @since 1.0
 */
public class Kongxinjuxing {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int h = 0, k = 0;
        while (h < 3) {
            System.out.println("请输入矩方形的高度：");
            h = input.nextInt();
        }
        while (k < 3) {
            System.out.println("请输入矩方形的宽度：");
            k = input.nextInt();
        }

        for (int j = 1; j <= h; j++) {
            for (int i = 1; i <= k; i++) {
                if (j == 1 || j == h || i == 1 || i == k) {
                    System.out.print("*");
                } else {
                    System.out.print("#");
                }
            }
            System.out.print("\n");
        }
    }
}
